package com.lyc.dao;

import com.lyc.dao.imp.SportingEventsDAOImpl;
import com.lyc.entity.SportingEvents;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;

/**
 * @Program: medal
 * @Author: YC
 * @Date: 2022/5/5 19:22
 */

public class SportingEventsDAOTest {
    private SportingEventsDAO dao = new SportingEventsDAOImpl();

    @Test
    public void insert() throws SQLException{
        dao.insert(new SportingEvents(102,"速度滑冰","123"));
    }

    @Test
    public void select() throws SQLException{
//        System.out.println(dao.selectById(101));
        System.out.println(dao.select(0,2));
    }

    @Test
    public void updateById() throws SQLException{
        dao.updateById(new SportingEvents(102,"花样滑冰"," 花样滑冰,就是选手穿着冰刀鞋,以技术动作为基本,在场地上做出的滑冰表演,然后裁判打分,最后得出排名。"));
    }

    @Test
    public void delete() throws SQLException{
        dao.deleteById(101);
    }
}
